package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.service.SetmealService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/*
    给移动端使用的后台
 */
@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Reference
    private SetmealService setmealService;


    @RequestMapping("/getSetmeal")
    public Result getSetmeal() {
        Result result = setmealService.findAll();
        return result;
    }


    @RequestMapping("/findById")
    public Result findById(@RequestParam("id") Integer setmealId) {
        Result result = setmealService.findById(setmealId);
        return result;
    }
}
